<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{% block title %}卡牌游戏{% endblock %}</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
    {% load static %}
    <link rel="stylesheet" href="{% static 'css/style.css' %}">
</head>
<body>
    <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
        <div class="container">
            <a class="navbar-brand" href="/">
                <i class="fas fa-gamepad"></i> 卡牌游戏
            </a>
            <div class="navbar-nav ms-auto">
                {% if user.is_authenticated %}
                    <span class="navbar-text me-3">
                        <i class="fas fa-coins"></i> {{ user.coins }}
                    </span>
                    <a class="nav-link" href="{% url 'user-profile' %}">
                        <i class="fas fa-user"></i> {{ user.nickname }}
                    </a>
                    <a class="nav-link" href="{% url 'user-logout' %}">
                        <i class="fas fa-sign-out-alt"></i> 登出
                    </a>
                {% else %}
                    <a class="nav-link" href="{% url 'user-login' %}">
                        <i class="fas fa-sign-in-alt"></i> 登录
                    </a>
                    <a class="nav-link" href="{% url 'user-register' %}">
                        <i class="fas fa-user-plus"></i> 注册
                    </a>
                {% endif %}
            </div>
        </div>
    </nav>

    <main class="container mt-4">
        {% block content %}
        {% endblock %}
    </main>

    <footer class="bg-dark text-light text-center py-3 mt-5">
        <div class="container">
            <p>&copy; 2024 卡牌游戏. All rights reserved.</p>
        </div>
    </footer>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
    <script src="{% static 'js/main.js' %}"></script>
    {% block scripts %}
    {% endblock %}
</body>
</html>
